<%@page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<%@include file="/includes/taglibs.jsp"%>
<%@page import="com.feib.soeasy.util.UserUtil"%>
<%@page import="com.feib.soeasy.util.CodeTableUtil"%>
<%@page import="com.feib.soeasy.model.Payment"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><%=UserUtil.getCurrentMenuItemName() %></title>
	<script type="text/javascript">
	<!--	
	$(document).ready(function() {	
		$("[id^='doQueryBtn']").click(function() {
			doQueryAction();
			
		});	
	});

	function doQueryAction()
	{

		var qryCode = $('#qryCode').val();
		var qryCodeName = $('#qryCodeName').val();

		$('#hidden\\.qryCode').val(qryCode);
		$('#hidden\\.qryCodeName').val(qryCodeName);
	
		
		$.ajax({url : "<c:url value='/ajax/Soez9005.action'/>",
			async : true,
			type : 'POST',
			data : $("#queryHiddenFrom").serialize(),
			dataType : 'html',
			success : function(data, textStatus, XMLHttpRequest){
					$("#commissionListDiv").html(data);
				},
			error : function(XMLHttpRequest, textStatus, errorThrown){
				$("#ajaxErrorMessageDiv").html('系統發生錯誤，請聯絡管理員');
				$("#ajaxErrorMessageDiv" ).dialog({  
					title:'系統錯誤' 
					,width: 600
					, resizable: false
					, modal: true
					, buttons: {
						Ok: function() {
							$( this ).dialog( "close" );
						}
					}
				});
				},
			complete: function(XMLHttpRequest, textStatus){closeWaitingDialog();
			$("#commissionListDiv").fadeTo("slow", 1);
			}
		});
	}

	function doModifyCommissionAction()
	{

		var qryCode = $('#qryCode').val();
		var qryCodeName = $('#qryCodeName').val();

		$('#hidden2\\.qryCode').val(qryCode);
		$('#hidden2\\.qryCodeName').val(qryCodeName);
	
		
		$.ajax({url : "<c:url value='/ajax/Soez9005.action'/>",
			async : true,
			type : 'POST',
			data : $("#confirmHiddenFrom").serialize(),
			dataType : 'html',
			success : function(data, textStatus, XMLHttpRequest){
					$("#commissionListDiv").html(data);
				},
			error : function(XMLHttpRequest, textStatus, errorThrown){
				$("#ajaxErrorMessageDiv").html('系統發生錯誤，請聯絡管理員');
				$("#ajaxErrorMessageDiv" ).dialog({  
					title:'系統錯誤' 
					,width: 600
					, resizable: false
					, modal: true
					, buttons: {
						Ok: function() {
							$( this ).dialog( "close" );
						}
					}
				});
				},
			complete: function(XMLHttpRequest, textStatus){
				closeWaitingDialog();
				$("#commissionListDiv").fadeTo("slow", 1);
			}
		});
	}
	
	//-->
	</script>
</head>
<body>
<div id="mainAreaCT">
		<jsp:include page="/includes/path.jsp"/>
		<jsp:include page="/includes/subMenu.jsp"/>
	<div id="queryFormDiv">
	<stripes:form id="queryPaymentFrom" beanclass="com.feib.soeasy.action.Soez9005ActionBean" 
			method="post" onsubmit="javascript: return false;">
		
		<table id="queryForm">
			<tr>
				<th>代碼</th>
				<td>
					<stripes:text id="qryCode" 
						name="qryCode" size="5" maxlength="5"/>

				</td>
			</tr>
			<tr>
				<th>代碼名稱</th>
				<td>
					<stripes:text id="qryCodeName" 
						name="qryCodeName" size="20" maxlength="20"/>
				</td>
			</tr>
			<tr>
				<td colspan="2" class="queryFunction">
					<stripes:button id="doQueryBtn" name="doQueryBtn" value="查詢"/>
					
				</td>
			</tr>
		</table>
		</stripes:form>
	</div><!-- end #queryForm -->
	


<!-- 繳費總覽查詢結果  -->
<div id="commissionListDiv" style="display: none;">
</div>
	
<div id="queryPaymentHiddenFormDiv" style="display: none;">
	<stripes:form id="queryHiddenFrom" beanclass="com.feib.soeasy.action.Soez9005ActionBean" 
		method="post" onsubmit="javascript: return false;">
		<stripes:hidden id="hidden.qryCode" name="qryCode"/>
		<stripes:hidden id="hidden.qryCodeName" name="qryCodeName"/>
		<input type="hidden" id="method" name="doAjaxQueryAction"/>
	</stripes:form>
</div>

<!-- Message -->
<div id="ajaxErrorMessageDiv" style="display: none;"></div>

</div>
</body>
</html>